<?php
/**
 * Created by PhpStorm.
 * User: gesangdianzi
 * Date: 2017/12/24
 * Time: 19:43
 */
use common\utils\Com;

$this->title = $word['title'];
$keyword = $word['keyword'];
$description = empty($word['info']) ? mb_substr(strip_tags($word['txt']['text']),0,90) : $word['info'];

?>
<?php $this->beginBlock('keyword'); ?>
<meta name="Keywords" content="<?=$keyword?>" />
<meta name="Description" content="<?=$description?>" />
<?php $this->endBlock(); ?>

<?=$this->render("@app/views/layouts/header",['title'=>"文章详情"])?>

<div class="article">
    <div class="head w-1200">
        <a href="/">首页</a> > <a href="<?=Com::urlCat($cat['id'])?>"><?=$cat['name']?></a> > <span><?=$word['title']?></span>
    </div>
    <div class="content">
        <div class="title"><?=$word['title']?></div>
        <p class="tip"><span>发布时间：<?=date("Y.m.d",$word['created_at'])?></span><span>来源：<?=Yii::$app->params['company']?></span></p>
        <?=Com::reUrl($word['txt']["text"])?>
    </div>
    <div class="next">

        <div class="pre">
            上一篇：
            <?php if($pre):?>
            <a href="<?=Com::urlNews($pre['id'])?>"><?=$pre['title']?></a>
            <?php endif;?>
        </div>
        <div class="next">
            下一篇：
            <?php if($next):?>
                <a href="<?=Com::urlNews($next['id'])?>"><?=$next['title']?></a>
            <?php endif;?>
        </div>
    </div>

    <div class="relation">
        <div class="title">相关文章</div>
        <div class="left">
            <ul>
                <?php if(!empty($list1)):?>
                    <?php foreach ($list1 as $item) :?>
                        <li><a href="<?=Com::urlNews($item['id'])?>"><?=$item['title']?></a></li>
                    <?php endforeach;?>
                <?php endif;?>
            </ul>
        </div>
        <div class="right">
            <ul>
                <?php if(!empty($list2)):?>
                    <?php foreach ($list2 as $item) :?>
                        <li><a href="<?=Com::urlNews($item['id'])?>"><?=$item['title']?></a></li>
                    <?php endforeach;?>
                <?php endif;?>
            </ul>
        </div>
    </div>
</div>
